home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 342_01.zip / I8255F08.C < prev    next >
C/C++ Source or Header  |  1993-04-03  |  1KB  |  49 lines

  1. /*-
  2.  *  ----------------------------------------------------------------------
  3.  *  File        :   I8255F08.C
  4.  *  Creator     :   Blake Miller
  5.  *  Version     :   01.00.00        February 1991
  6.  *  Language    :   Microsoft C     Version 5.1
  7.  *  Purpose     :   Intel 8255 Compatible Digital IO Functions
  8.  *              :   Read All 8255 Bytes
  9.  *  ----------------------------------------------------------------------
  10.  */
  11.  
  12. #define  I8255F08_C_DEFINED  1
  13. #include "I8255FN.H"
  14. #undef   I8255F08_C_DEFINED
  15.  
  16. void I8255_load_bytes (I8255DAT *data);
  17.  
  18. /*- I8255 : Load Bytes -----------------------**
  19.  *  Read all of the bytes of the 8255 into the data area.
  20.  *  Passed:
  21.  *      pointer :   I8255DAT
  22.  *  Returns:
  23.  *      nothing
  24.  */
  25. void I8255_load_bytes (I8255DAT *data)
  26.     {
  27.     unsigned char   ival;   /* input value  */
  28.  
  29.     /* Port A data */
  30.     chp_portrd ( I8255_PORTA(data->base), &ival );
  31.     data->adat = ival;
  32.  
  33.     /* Port B data */
  34.     chp_portrd ( I8255_PORTB(data->base), &ival );
  35.     data->bdat = ival;
  36.  
  37.     /* Port C data */
  38.     chp_portrd ( I8255_PORTC(data->base), &ival );
  39.     data->cdat = ival;
  40.  
  41.     data->stat = I8255_ST_OK;
  42.     }
  43.  
  44. /*-
  45.  *  ----------------------------------------------------------------------
  46.  *  END I8255F08.C Source File
  47.  *  ----------------------------------------------------------------------
  48.  */
  49.